//
//  SongSheetCell.m
//  Kugou-OC
//
//  Created by BH on 16/6/12.
//  Copyright © 2016年 Sunny. All rights reserved.
//

#import "SongSheetCell.h"
#import "GlobalDefine.h"
#import <SDAutoLayout/UIView+SDAutoLayout.h>

@interface SongSheetCell ()

@property(nonatomic,strong)UIImageView *earphoneImg;
@property(nonatomic,strong)UIImageView *playImg;

@end

@implementation SongSheetCell

-(id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        _iconImg = ALLOC(UIImageView);
        _titleLab = ALLOC(UILabel);
        _playcountLab = ALLOC(UILabel);
        _earphoneImg = ALLOC(UIImageView);
        _playImg = ALLOC(UIImageView);
        
        [self.contentView sd_addSubviews:@[_iconImg,_titleLab,_playcountLab,_earphoneImg,_playImg]];
    }
    
    return self;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    
    _iconImg.sd_layout.leftSpaceToView(self.contentView,0).topSpaceToView(self.contentView,0).widthIs((SCREEN_WIDTH-45)/2).heightEqualToWidth();
    
    _titleLab.numberOfLines = 0;
    _titleLab.font = TITLE_THIRD_FONT;
    _titleLab.sd_layout.leftSpaceToView(self.contentView,5).rightSpaceToView(self.contentView,5).topSpaceToView(_iconImg,5).bottomSpaceToView(self.contentView,5);
    
    _earphoneImg.sd_layout.leftSpaceToView(self.contentView,5).bottomSpaceToView(_titleLab,15).widthIs(13).heightEqualToWidth();
    _earphoneImg.image = IMAGE(@"songsheet_earphone_img");
    
    _playImg.sd_layout.rightSpaceToView(self.contentView,5).bottomSpaceToView(_titleLab,5).widthIs(35).heightEqualToWidth();
    _playImg.image = IMAGE(@"listen_play_normal");
    
    _playcountLab.sd_layout.leftSpaceToView(_earphoneImg,5).topEqualToView(_earphoneImg).bottomEqualToView(_earphoneImg).rightSpaceToView(_playImg,5);
    _playcountLab.textColor = [UIColor whiteColor];
    _playcountLab.font = TITLE_FOUR_FONT;
}

@end
